package com.xw.mailservice.controller;

import java.util.List;

import com.xw.mailservice.beans.MailBox;
import com.xw.mailservice.contents.RetCodeEnums;
import com.xw.mailservice.model.JsonResponse;
import com.xw.mailservice.service.MailBoxService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 描述:收件箱相关配置接口
 * @author 杨建全
 * @date 2017年4月24日 上午11:29:07
 */
@Api("邮箱配置相关接口")
@RequestMapping("/mailBox")
@RestController
public class MailBoxController {
	
	@Autowired
	private MailBoxService mailBoxService;
	
	@GetMapping("/all")
	@ApiOperation(value="获取所有收件箱接口",notes="获取所有收件箱接口",httpMethod="GET",produces= MediaType.APPLICATION_JSON_VALUE)
	public JsonResponse getAllMailBox(){
		List<MailBox> allMailBox = mailBoxService.getAllMailBox();
		return new JsonResponse(RetCodeEnums.SUCCESS,allMailBox,"请求成功！");
	}
}
